Skip to main content

Snipping Region

AutomatR.Windows.Activities.SnippingRegion

The "Snipping Region" activity in AutomatR for Windows Automation captures a specific region of the screen and saves it as an image file. This activity is particularly useful for extracting visual information from specific areas of the screen.

Properties

NameDescription
Input
Region SelectionThe name or path of the image file representing the region to be captured.
File PathRepresents the file path where the captured image will be saved. It is of type string.
File NameRepresents the name of the file to be saved. It is of type string.
RegionRepresents a System.Drawing.Rectangle object that defines the region to capture.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before starting the "Snipping Region" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Output
Get File PathOutputs the full file path of the captured image. It is of type string.

How to use:

  1. Drag and drop the "Snipping Region" activity onto the workflow.
  2. Configure the properties by providing the necessary inputs, such as the delay, region selection, file path, file name, and region.
  3. Optionally, configure the delay.
  4. Execute the workflow to capture the specified region of the screen and save it as an image file.

Example: Consider an example where the "Snipping Region" activity is used to capture a region of the screen and save it as an image:

Snipping Region:
Delay: 2
Region Selection: "C:\Path\To\Image.png"
File Path: "C:\Path\To\Save"
File Name: "CapturedImage"
Region: new System.Drawing.Rectangle(100, 100, 300, 200)
Get File Path: CapturedFilePath

In this example, the activity captures a region defined by the System.Drawing.Rectangle (100, 100, 300, 200) after a 2-second delay and saves the image as "CapturedImage.png" in the specified file path. The full file path of the captured image is stored in the variable "CapturedFilePath" for further use in the workflow.